/**
 * This is my code.
 *
 * $Id$
 */
package fi.jab.esb.config.xml.impl;

import fi.jab.esb.config.xml.HibernateProviderType;
import fi.jab.esb.config.xml.XmlPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Hibernate Provider Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link fi.jab.esb.config.xml.impl.HibernateProviderTypeImpl#getHibernateCfgFile <em>Hibernate Cfg File</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HibernateProviderTypeImpl extends BusProviderImpl implements HibernateProviderType
{
  /**
   * The default value of the '{@link #getHibernateCfgFile() <em>Hibernate Cfg File</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHibernateCfgFile()
   * @generated
   * @ordered
   */
  protected static final String HIBERNATE_CFG_FILE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getHibernateCfgFile() <em>Hibernate Cfg File</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getHibernateCfgFile()
   * @generated
   * @ordered
   */
  protected String hibernateCfgFile = HIBERNATE_CFG_FILE_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected HibernateProviderTypeImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return XmlPackage.Literals.HIBERNATE_PROVIDER_TYPE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getHibernateCfgFile()
  {
    return hibernateCfgFile;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setHibernateCfgFile(String newHibernateCfgFile)
  {
    String oldHibernateCfgFile = hibernateCfgFile;
    hibernateCfgFile = newHibernateCfgFile;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XmlPackage.HIBERNATE_PROVIDER_TYPE__HIBERNATE_CFG_FILE, oldHibernateCfgFile, hibernateCfgFile));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_PROVIDER_TYPE__HIBERNATE_CFG_FILE:
        return getHibernateCfgFile();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_PROVIDER_TYPE__HIBERNATE_CFG_FILE:
        setHibernateCfgFile((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_PROVIDER_TYPE__HIBERNATE_CFG_FILE:
        setHibernateCfgFile(HIBERNATE_CFG_FILE_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case XmlPackage.HIBERNATE_PROVIDER_TYPE__HIBERNATE_CFG_FILE:
        return HIBERNATE_CFG_FILE_EDEFAULT == null ? hibernateCfgFile != null : !HIBERNATE_CFG_FILE_EDEFAULT.equals(hibernateCfgFile);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (hibernateCfgFile: ");
    result.append(hibernateCfgFile);
    result.append(')');
    return result.toString();
  }

} //HibernateProviderTypeImpl
